from typing import List, Dict, Tuple, Optional, Union, Any, Callable
import functools

# 基本类型注解


def greet(name: str) -> str:
    return f"Hello, {name}!"


# 容器类型注解
def process_scores(scores: List[int]) -> Dict[str, float]:
    return {"average": sum(scores) / len(scores)}


# 可选类型
def find_user(user_id: int) -> Optional[Dict[str, Any]]:
    if user_id == 1:
        return {"name": "Alice", "age": 25}
    return None


# 联合类型
def process_data(data: Union[str, int, List]) -> str:
    return str(data)
